<?php

//get all category	
function getAllCategory(){
	$qr ="SELECT * FROM category";
	return mysql_query($qr);
}

//add category	
function addCategory($categoryName,$description){
	$qr ="INSERT INTO category(CategoryName,Description) VALUES('$categoryName','$description')";
	mysql_query($qr);
}

//get category by id	
function getCategoryByID($categoryID){
	$qr ="SELECT * FROM category WHERE CategoryID = $categoryID;";
	return mysql_query($qr);
}

//edit category	
function editCategory($categoryName,$description,$categoryID){
	$qr ="UPDATE category SET CategoryName = '$categoryName',Description = '$description' WHERE CategoryID = $categoryID; ";
	mysql_query($qr);
}

?>